using AdminSG3L.Applicaticn.Dtos;
using AdminSG3L.Applicaticn.Commands;
using AdminSG3L.Domain.Entities;

namespace AdminSG3L.Applicaticn.ServicesInterface;

/// <summary>
/// 日志服务接口
/// </summary>
public interface ILogService
{
    /// <summary>
    /// 获取分页日志列表
    /// </summary>
    /// <param name="pageIndex">页码</param>
    /// <param name="pageSize">页面大小</param>
    /// <param name="search">搜索条件</param>
    /// <returns>分页日志结果</returns>
    Task<ApiResponse<(IEnumerable<LogDto> Logs, int TotalCount)>> GetPagedLogsAsync(int pageIndex, int pageSize, LogSearchDto? search = null);

    /// <summary>
    /// 获取日志统计
    /// </summary>
    /// <param name="search">搜索条件</param>
    /// <returns>日志统计结果</returns>
    Task<ApiResponse<LogStatsDto>> GetLogStatsAsync(LogSearchDto? search = null);

    /// <summary>
    /// 根据ID获取日志详情
    /// </summary>
    /// <param name="id">日志ID</param>
    /// <returns>日志详情</returns>
    Task<ApiResponse<LogDto?>> GetLogByIdAsync(Guid id);

    /// <summary>
    /// 清除日志
    /// </summary>
    /// <param name="clearLogsDto">清除条件</param>
    /// <returns>清除结果</returns>
    Task<ApiResponse<int>> ClearLogsAsync(ClearLogsDto clearLogsDto);

    /// <summary>
    /// 导出日志
    /// </summary>
    /// <param name="search">搜索条件</param>
    /// <returns>导出的日志数据</returns>
    Task<ApiResponse<IEnumerable<LogDto>>> ExportLogsAsync(LogSearchDto? search = null);
}
